package sample.FirstThread.Demo;

public class ThirdThread {
	public static void main(String[] args) {
		TwoThread two = new TwoThread();
		Thread th = new Thread(two);
		th.start();
		
		Thread th2 = new Thread(two);
		th2.start();
		for(int i=0;i<100;i++)
			System.out.println(Thread.currentThread().getName()+"  "+i);
	}

}

class TwoThread implements Runnable{

	public void run() {
		Two_OneThread two_one = new Two_OneThread();
		Thread th_one = new Thread(two_one);
		th_one.start();
		for(int i=0;i<100;i++)
			System.out.println(Thread.currentThread().getName()+"  "+i);
	}
	
}

class Two_OneThread implements Runnable{

	public void run() {
		for(int i=0;i<100;i++)
			System.out.println(Thread.currentThread().getName()+"---  "+i);
		
//		Thread two_one = new Thread();
	}	
}